{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
function statusChange(planningId,idStatus)
{
  var datastring = " planningId= " + planningId + "&status= " + idStatus;

	if(idStatus == 1)
	{
		if(confirm('Do you really want to make its status OK ??? '))
		{
			$.ajax({
		    url: "statusChange.php",
		    type: "POST",
		    data: datastring,
		    success: function(data){
		    	location.reload();
		    }
		  });
		}
	}
	else
	{
		if(confirm('Do you really want to make its status NOT OK ??? '))
		{
			$.ajax({
		    url: "statusChange.php",
		    type: "POST",
		    data: datastring,
		    success: function(data){
		    	location.reload();
		    }
		  });
		}
	}
}
</script>
{/block}
{block name=body}
<table border='0' cellpadding='1' cellspacing='2' align='center'>
<tr>
  <td colspan="9" class="table1" align="center">* * LogShit List * *</td>
</tr>
<tr>
  <td  class="table1" align='center'><b>Status</b></td>	
	<td  class="table1" align='center'><b>Challan</b></td>
	<td  class="table1" align='center'><b>Party</b></td>
	<td  class="table1" align='center'><b>Quantity</b></td>
	<td  class="table1" align='center'><b>Weight</b></td>
	<td  class="table1" align='center'><b>Process 1</b></td>
	<td  class="table1" align='center'><b>Process 2</b></td>
	<td  class="table1" align='center'><b>Process 3</b></td>
	<td  class="table1" align='center'><b>&bull;</b></td>
</tr>
{section name="sec" loop=$plannArray}
<tr id="{$smarty.section.sec.rownum}">
	<td class="table2" align="center">
		<input type="button" name="okBtn" value=" OK " id="okBtn" onclick="statusChange({$plannArray[sec].planningId},1);" />
		<input type="button" name="notOkBtn" value=" NOT OK " id="notOkBtn" onclick="statusChange({$plannArray[sec].planningId},-1);" />
  </td>
  <td class="table2" align="left">{$plannArray[sec].challan}</td>
  <td class="table2" align="center">{$plannArray[sec].partyName}</td>
  <td class="table2" align="center">{$plannArray[sec].quantity}</td>
  <td class="table2" align="center">{$plannArray[sec].weight}</td>
  <td class="table2" align="center" NOWRAP>{$plannArray[sec].proName1}</td>
  <td class="table2" align="center" NOWRAP>{$plannArray[sec].proName2}</td>
  <td class="table2" align="center" NOWRAP>{$plannArray[sec].proName3}</td>
  <td class="table2" align="center"><a href="planningDetail.php?planningId={$plannArray[sec].planningId}" target="_blank">Details</a></td>
</tr>
{sectionelse}
<tr>
  <td colspan="8" align="center">
    {$msg}
  </td>
</tr> 
{/section}
</table>
{/block}